Fix access control for non-public templates (enforce ownership for non-admin users)#12683
Fix access control for non-public templates (enforce ownership for non-admin users)#12683sudo87 wants to merge 2 commits intoapache:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12683 +/- ##
============================================
+ Coverage 17.92% 18.00% +0.08%
- Complexity 16154 16465 +311
============================================
Files 5939 5977 +38
Lines 533181 537728 +4547
Branches 65237 66025 +788
============================================
+ Hits 95585 96840 +1255
- Misses 426856 429968 +3112
- Partials 10740 10920 +180
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@blueorangutan package |
|
@sudo87 a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16937 |
There was a problem hiding this comment.
Pull request overview
This PR fixes an access control issue for non-public templates accessed by non-admin users. The fix ensures that ownership semantics are properly enforced by changing the sameOwner parameter from false to true in the access check for non-public templates.
Changes:
- Fixed access control check for non-public templates to enforce ownership semantics by setting
sameOwner=trueinstead offalse - Minor code formatting change (consolidating else-if statement onto one line)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@sudo87 is this change related to a specific issue/situation? This flag is just used to ensure that all the controlled entities provided to |
Hi @winterhazel, this change is based on how checkAccess is used here. Right now we pass sameOwner = false, which effectively relaxes the ownership check. Please let me know if change makes sense. |
@sudo87 have a look at what |
|
Thanks @winterhazel for the hint, I misunderstood the flow. Since both branches were effectively doing the same checkAccess call, I have consolidated them. Please review if changes are good. |
Description
Permission access check looks incorrect for non-public template and non admin user.
Provided non-public templates are not shareable, check must ensure that template is owned by user. For public, ownership flag is passed as false, which makes sense as template can be created by other user.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?